<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.polynomials.groebner_&rdquo;</title>
        </head>
        <body><h1 class="module">Module s.p.groebner_</h1><span id="part">Part of <a href="sympy.polynomials.html">sympy.polynomials</a></span><div class="toplevel"><div><p>Algorithms for the computation of Groebner bases</p>
</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.groebner_.groebner">groebner</a></td><td><div><p>Computes a (reduced) Groebner base for a given list of polynomials.</p>
</div></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.groebner_.groebner">groebner(f, var=None, order=None, reduced=True):</a></div>
            <div class="functionBody"><div><p>Computes a (reduced) Groebner base for a given list of polynomials.</p>
<h1 class="heading">Usage:</h1>
  <p>The input consists of a list of polynomials, either as SymPy 
  expressions or instances of Polynomials. In the first case, you should 
  also specify the variables and the monomial order with the arguments 
  'var' and 'order'. Only the first polynomial is checked for its type, the
  rest is assumed to match.</p>
  <p>By default, this algorithm returns the unique reduced Groebner base 
  for the given ideal. By setting reduced=False, you can prevent the 
  reduction steps.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>G = groebner([x**2 + y**3, y**2-x], order=<span class="py-string">'lex'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">for</span> g <span class="py-keyword">in</span> G: <span class="py-keyword">print</span> g
<span class="py-output">x - y**2</span>
<span class="py-output">y**3 + y**4</span></pre>
<h1 class="heading">Notes:</h1>
  <p>Groebner bases are used to choose specific generators for a polynomial
  ideal. Because these bases are unique, you can check for ideal equality, 
  by comparing the Groebner bases. To see if one polynomial lies in on 
  ideal, divide by the elements in the base and see if the remainder if 0. 
  They can also be applied to equation systems: By choosing lexicographic 
  ordering, you can eliminate one variable at a time, given that the ideal 
  is zero-dimensional (finite number of solutions).</p>
  <p>Here, an improved version of Buchberger's algorithm is used. For all 
  pairs of polynomials, the s-polynomial is computed, by mutually 
  eliminating the leading terms of these 2 polynomials. It's remainder 
  (after division by the base) is then added. Sometimes, it is easy to see,
  that one s-polynomial will be reduced to 0 before computing it. At the 
  end, the base is reduced, by trying to eliminate as many terms as 
  possible with the leading terms of other base elements. The final step is
  to make all polynomials monic.</p>
<h1 class="heading">References:</h1>
  <p>Cox, Little, O'Shea: Ideals, Varieties and Algorithms, Springer, 2. 
  edition, p. 87</p>
</div></div>
            </div></body>
        